package com.bos.mapper;

import com.bos.data.model.BosBehaviorModel;
import com.bos.data.model.BosParamModel;
import com.bos.data.model.BosUserModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface Bos_behaviorMapper {
    //1.查询出Bos_behavior中的数据
    @Select("select * from Bos_behavior")
    public List<BosBehaviorModel> findBehavior();

    //2.将数据插入到Bos_behavior 中
    @Insert("insert into Bos_behavior values(#{bname},#{bType},#{code},#{regular},#{bContent},#{bCondition},#{bDate},#{servious},#{people},#{coin},#{remark},#{others1},#{others2},#{others3})")
    public int insertBehavior(BosBehaviorModel behavior);

    //3.根据id删除表中的数据
    @Delete("delete from Bos_behavior where id=#{id}")
    public int deleteById(int bid);

    //4.根据id查询出对应的数据
    @Select("select * from Bos_behavior where id=#{id}")
    public BosBehaviorModel findByBehavior(int bid);

    //5.根据id修改数据
    @Update("update Bos_behavior set bname=#{bname},bType=#{bType},code=#{code},regular=#{regular},bContent=#{bContent},bCondition=#{bCondition},bDate=#{bDate},servious=#{servious},people=#{people},coin=#{coin},remark=#{remark},others1=#{others1},others2=#{others2},others3=#{others3} where id=#{id} ")
    public int updateByID(BosBehaviorModel behavior);

    //6.根据typeName为项目进度查询出数据
    @Select("select * from bos_param where typeName=#{typeName}")
    public List<BosParamModel> findBos_params(String typeName);
    //7.查询出所有的用户信息
    @Select("select * from bos_user")
    public List<BosUserModel> findUsers();
}

